
#include "shell.h"
#include "stdio.h"

//============================================================================
//add user "root",pwd=123456
SHELL_EXPORT_USER(SHELL_CMD_PERMISSION(0xff), root, 123456, add user);
//add user "wood",pwd=888888
SHELL_EXPORT_USER(SHELL_CMD_PERMISSION(0x03), wood, 888888, add user);

//============================================================================
//fun type main
int mainfunc(int argc, char *argv[])
{
    printf("%d parameter(s)\r\n", argc);
    for (char i = 1; i < argc; i++)
    {
        printf("%s\r\n", argv[i]);
    }
    return  0;
}

//add cmd
SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0x01)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_MAIN), func0, mainfunc, test1);
//letter:/$ func "hello world"
//2 parameter(s)
//hello world
SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0x02)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_MAIN), func2, mainfunc, test2);


SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0x06)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_MAIN), func3, mainfunc, test4);


SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0x08)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_MAIN), func4, mainfunc, test5);


//============================================================================
//fun type function
int functype(int i, char ch, char *str)
{
    printf("input int: %d, char: %c, string: %s\r\n", i, ch, str);
    return  0;
}


//add cmd
SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC), func1, functype, test3);
//letter:/$ func1 666 'A' "hello world"
//input int: 666, char: A, string: hello world
 


